package cc.linker.steplink.crm.merchanth5.controller;


import cc.linker.steplink.crm.commons.domain.WxUser;
import cc.linker.steplink.crm.merchanth5.commons.RequestFilter;
import cc.linker.steplink.crm.merchanth5.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;


/**
 * 供货商 H5接口
 * @author huhj
 */

@RestController
@RequestMapping("/h5/supplier")
public class SupplierController {

    @Autowired
    private SupplierService supplierService;
    @Autowired
    private RequestFilter requestFilter;

    @GetMapping("/getinfo")
    public Map<String,Object> getInfo(Long goodsId,HttpServletRequest request){
        WxUser wxUser = requestFilter.getWxUser(request);
        String orgId = wxUser.getOrgId();
        Map<String,Object> param = new HashMap<>();
        param.put("orgId",orgId);
        param.put("goodsId",goodsId);
        return supplierService.getInfo(param);
    }

}
